"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DbConfig = void 0;
const Logger_1 = require("../engine/utils/Logger");
class DbConfig {
    constructor(host, port, user, pass) {
        this.host = "";
        this.port = 3306;
        this.user = "";
        this.pass = "";
        this.host = host;
        this.port = port;
        this.user = user;
        this.pass = pass;
    }
    static init(dbType = DbConfig.Db_Type.Dev) {
        this.now_db_type = dbType;
    }
    static getDbConfig(dbType) {
        let db = this.dbMap.get(dbType);
        if (db) {
            return db;
        }
        else {
            Logger_1.Logger.error("不存在数据库配置:" + dbType);
        }
    }
}
exports.DbConfig = DbConfig;
DbConfig.Db_Type = {
    Dev: 1,
    Test: 2,
    Online: 3,
    yueyouhui: 4,
    xj: 6,
    chaoju_new: 7,
    Jk: 8,
    chaoyou: 9,
};
DbConfig.now_db_type = DbConfig.Db_Type.Online;
DbConfig.Db_Name = {
    db_account: "db_account",
    db_yuxiaxie: "db_yuxiaxie",
    db_laoyou: "db_laoyou",
    db_yxx: "laoyou",
};
DbConfig.dbMap = new Map()
    .set(DbConfig.Db_Type.Dev, new DbConfig("121.37.251.120", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.Test, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.Online, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.chaoju_new, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.yueyouhui, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.xj, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.Jk, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"))
    .set(DbConfig.Db_Type.chaoyou, new DbConfig("127.0.0.1", 3306, "root", "f301517757c8cf6c"));
